\(\int \frac {\cos (c+d x) \cot ^3(c+d x)}{a+a \sin (c+d x)} \, dx\) [415]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 58 \[ \int \frac {\cos (c+d x) \cot ^3(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {x}{a}+\frac {\text {arctanh}(\cos (c+d x))}{2 a d}+\frac {\cot (c+d x)}{a d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a d} \]

[Out]

x/a+1/2*arctanh(cos(d*x+c))/a/d+cot(d*x+c)/a/d-1/2*cot(d*x+c)*csc(d*x+c)/a/d

Rubi [A] (verified)

Time = 0.08 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {2918, 2691, 3855, 3554, 8} \[ \int \frac {\cos (c+d x) \cot ^3(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\text {arctanh}(\cos (c+d x))}{2 a d}+\frac {\cot (c+d x)}{a d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a d}+\frac {x}{a} \]

[In]

Int[(Cos[c + d*x]*Cot[c + d*x]^3)/(a + a*Sin[c + d*x]),x]

[Out]

x/a + ArcTanh[Cos[c + d*x]]/(2*a*d) + Cot[c + d*x]/(a*d) - (Cot[c + d*x]*Csc[c + d*x])/(2*a*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 2918

Int[((cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.))/((a_) + (b_.)*sin[(e_.) + (f_
.)*(x_)]), x_Symbol] :> Dist[g^2/a, Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^n, x], x] - Dist[g^2/(b*d),
Int[(g*Cos[e + f*x])^(p - 2)*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x] && EqQ[a^2
 - b^2, 0]

Rule 3554

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = -\frac {\int \cot ^2(c+d x) \, dx}{a}+\frac {\int \cot ^2(c+d x) \csc (c+d x) \, dx}{a} \\ & = \frac {\cot (c+d x)}{a d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a d}-\frac {\int \csc (c+d x) \, dx}{2 a}+\frac {\int 1 \, dx}{a} \\ & = \frac {x}{a}+\frac {\text {arctanh}(\cos (c+d x))}{2 a d}+\frac {\cot (c+d x)}{a d}-\frac {\cot (c+d x) \csc (c+d x)}{2 a d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.81 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.76 \[ \int \frac {\cos (c+d x) \cot ^3(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\left (\csc \left (\frac {1}{2} (c+d x)\right )+\sec \left (\frac {1}{2} (c+d x)\right )\right )^2 \left (\left (2 c+2 d x+\log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )\right ) \sin ^2(c+d x)+\cos (c+d x) (-1+2 \sin (c+d x))\right )}{8 a d (1+\sin (c+d x))} \]

[In]

Integrate[(Cos[c + d*x]*Cot[c + d*x]^3)/(a + a*Sin[c + d*x]),x]

[Out]

((Csc[(c + d*x)/2] + Sec[(c + d*x)/2])^2*((2*c + 2*d*x + Log[Cos[(c + d*x)/2]] - Log[Sin[(c + d*x)/2]])*Sin[c
+ d*x]^2 + Cos[c + d*x]*(-1 + 2*Sin[c + d*x])))/(8*a*d*(1 + Sin[c + d*x]))

Maple [A] (verified)

Time = 0.26 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.24

method result size
parallelrisch \(\frac {-\left (\cot ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )+8 d x +4 \cot \left (\frac {d x}{2}+\frac {c}{2}\right )-4 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-4 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d a}\) \(72\)
derivativedivides \(\frac {\frac {\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {2}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-2 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+8 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d a}\) \(84\)
default \(\frac {\frac {\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}-2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {1}{2 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}}+\frac {2}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}-2 \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+8 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d a}\) \(84\)
risch \(\frac {x}{a}+\frac {{\mathrm e}^{3 i \left (d x +c \right )}+{\mathrm e}^{i \left (d x +c \right )}+2 i {\mathrm e}^{2 i \left (d x +c \right )}-2 i}{a d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d a}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d a}\) \(100\)
norman \(\frac {\frac {x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}+\frac {x \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a}-\frac {1}{8 a d}+\frac {3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d a}-\frac {3 \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d a}+\frac {\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )}{8 d a}+\frac {\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )}{2 d a}+\frac {\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d a}+\frac {3 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d a}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {\ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a d}\) \(245\)

[In]

int(cos(d*x+c)^4*csc(d*x+c)^3/(a+a*sin(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/8*(-cot(1/2*d*x+1/2*c)^2+tan(1/2*d*x+1/2*c)^2+8*d*x+4*cot(1/2*d*x+1/2*c)-4*tan(1/2*d*x+1/2*c)-4*ln(tan(1/2*d
*x+1/2*c)))/d/a

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.79 \[ \int \frac {\cos (c+d x) \cot ^3(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {4 \, d x \cos \left (d x + c\right )^{2} - 4 \, d x + {\left (\cos \left (d x + c\right )^{2} - 1\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - {\left (\cos \left (d x + c\right )^{2} - 1\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - 4 \, \cos \left (d x + c\right ) \sin \left (d x + c\right ) + 2 \, \cos \left (d x + c\right )}{4 \, {\left (a d \cos \left (d x + c\right )^{2} - a d\right )}} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^3/(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/4*(4*d*x*cos(d*x + c)^2 - 4*d*x + (cos(d*x + c)^2 - 1)*log(1/2*cos(d*x + c) + 1/2) - (cos(d*x + c)^2 - 1)*lo
g(-1/2*cos(d*x + c) + 1/2) - 4*cos(d*x + c)*sin(d*x + c) + 2*cos(d*x + c))/(a*d*cos(d*x + c)^2 - a*d)

Sympy [F]

\[ \int \frac {\cos (c+d x) \cot ^3(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\int \frac {\cos ^{4}{\left (c + d x \right )} \csc ^{3}{\left (c + d x \right )}}{\sin {\left (c + d x \right )} + 1}\, dx}{a} \]

[In]

integrate(cos(d*x+c)**4*csc(d*x+c)**3/(a+a*sin(d*x+c)),x)

[Out]

Integral(cos(c + d*x)**4*csc(c + d*x)**3/(sin(c + d*x) + 1), x)/a

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 138 vs. \(2 (54) = 108\).

Time = 0.31 (sec) , antiderivative size = 138, normalized size of antiderivative = 2.38 \[ \int \frac {\cos (c+d x) \cot ^3(c+d x)}{a+a \sin (c+d x)} \, dx=-\frac {\frac {\frac {4 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {\sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}{a} - \frac {16 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} + \frac {4 \, \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a} - \frac {{\left (\frac {4 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )} {\left (\cos \left (d x + c\right ) + 1\right )}^{2}}{a \sin \left (d x + c\right )^{2}}}{8 \, d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^3/(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

-1/8*((4*sin(d*x + c)/(cos(d*x + c) + 1) - sin(d*x + c)^2/(cos(d*x + c) + 1)^2)/a - 16*arctan(sin(d*x + c)/(co
s(d*x + c) + 1))/a + 4*log(sin(d*x + c)/(cos(d*x + c) + 1))/a - (4*sin(d*x + c)/(cos(d*x + c) + 1) - 1)*(cos(d
*x + c) + 1)^2/(a*sin(d*x + c)^2))/d

Giac [A] (verification not implemented)

none

Time = 0.33 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.78 \[ \int \frac {\cos (c+d x) \cot ^3(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {\frac {8 \, {\left (d x + c\right )}}{a} - \frac {4 \, \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right )}{a} + \frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 4 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a^{2}} + \frac {6 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 4 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1}{a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}}{8 \, d} \]

[In]

integrate(cos(d*x+c)^4*csc(d*x+c)^3/(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

1/8*(8*(d*x + c)/a - 4*log(abs(tan(1/2*d*x + 1/2*c)))/a + (a*tan(1/2*d*x + 1/2*c)^2 - 4*a*tan(1/2*d*x + 1/2*c)
)/a^2 + (6*tan(1/2*d*x + 1/2*c)^2 + 4*tan(1/2*d*x + 1/2*c) - 1)/(a*tan(1/2*d*x + 1/2*c)^2))/d

Mupad [B] (verification not implemented)

Time = 10.29 (sec) , antiderivative size = 159, normalized size of antiderivative = 2.74 \[ \int \frac {\cos (c+d x) \cot ^3(c+d x)}{a+a \sin (c+d x)} \, dx=\frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,a\,d}-\frac {2\,\mathrm {atan}\left (\frac {2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )-\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )+2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{a\,d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,a\,d}-\frac {\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2\,a\,d}+\frac {\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,a\,d}-\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{2\,a\,d} \]

[In]

int(cos(c + d*x)^4/(sin(c + d*x)^3*(a + a*sin(c + d*x))),x)

[Out]

tan(c/2 + (d*x)/2)^2/(8*a*d) - (2*atan((2*cos(c/2 + (d*x)/2) - sin(c/2 + (d*x)/2))/(cos(c/2 + (d*x)/2) + 2*sin
(c/2 + (d*x)/2))))/(a*d) - cot(c/2 + (d*x)/2)^2/(8*a*d) - log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))/(2*a*d) +
 cot(c/2 + (d*x)/2)/(2*a*d) - tan(c/2 + (d*x)/2)/(2*a*d)